package cn.lngaosu.lwyd.module.integration.dal.mysql.weibocommentsshow;

import java.util.*;

import cn.lngaosu.lwyd.framework.common.pojo.PageResult;
import cn.lngaosu.lwyd.framework.mybatis.core.query.LambdaQueryWrapperX;
import cn.lngaosu.lwyd.framework.mybatis.core.mapper.BaseMapperX;
import cn.lngaosu.lwyd.module.integration.dal.dataobject.weibocommentsshow.WeiboCommentsShowDO;
import org.apache.ibatis.annotations.Mapper;
import cn.lngaosu.lwyd.module.integration.controller.admin.weibocommentsshow.vo.*;

/**
 * 微博评论 Mapper
 *
 * @author 张恒
 */
@Mapper
public interface WeiboCommentsShowMapper extends BaseMapperX<WeiboCommentsShowDO> {

    default PageResult<WeiboCommentsShowDO> selectPage(WeiboCommentsShowPageReqVO reqVO) {
        return selectPage(reqVO, new LambdaQueryWrapperX<WeiboCommentsShowDO>()
                .betweenIfPresent(WeiboCommentsShowDO::getCreateTime, reqVO.getCreateTime())
                .betweenIfPresent(WeiboCommentsShowDO::getSyncDate, reqVO.getSyncDate())
                .eqIfPresent(WeiboCommentsShowDO::getWeiboUid, reqVO.getWeiboUid())
                .eqIfPresent(WeiboCommentsShowDO::getWeiboId, reqVO.getWeiboId())
                .eqIfPresent(WeiboCommentsShowDO::getCreatedAt, reqVO.getCreatedAt())
                .eqIfPresent(WeiboCommentsShowDO::getCommentId, reqVO.getCommentId())
                .eqIfPresent(WeiboCommentsShowDO::getText, reqVO.getText())
                .eqIfPresent(WeiboCommentsShowDO::getSource, reqVO.getSource())
                .eqIfPresent(WeiboCommentsShowDO::getAuthorId, reqVO.getAuthorId())
                .likeIfPresent(WeiboCommentsShowDO::getScreenName, reqVO.getScreenName())
                .eqIfPresent(WeiboCommentsShowDO::getProfileImageUrl, reqVO.getProfileImageUrl())
                .orderByDesc(WeiboCommentsShowDO::getId));
    }

}